package com.cy.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName : Knife4jConfiguration
 * @Description :
 * @Author :
 */
@Configuration
public class Knife4jConfiguration {

    @Bean
    public OpenAPI customOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("智能在线平台接口")
                        .version("1.0")
                        .description("后端接口")
                        .termsOfService("http://doc.xiaominfo.com")
                        .license(new License().name("Apache 2.0")
                                .url("http://doc.xiaominfo.com")));
    }
    @Bean
    public GroupedOpenApi userAPI() {
        return GroupedOpenApi.builder().group("用户管理").
                pathsToMatch("/users/**").
                build();
    }

    @Bean
    public GroupedOpenApi SchoolInfoAPI() {
        return GroupedOpenApi.builder().group("学籍信息管理").
                pathsToMatch("/schoolinfo/**").
                build();
    }
    @Bean
    public GroupedOpenApi UsercoursesAPI() {
        return GroupedOpenApi.builder().group("选课管理").
                pathsToMatch("/usercourses/**").
                build();
    }
    @Bean
    public GroupedOpenApi StatisticsAPI() {
        return GroupedOpenApi.builder().group("数据统计管理").
                pathsToMatch("/statistics/**").
                build();
    }
    @Bean
    public GroupedOpenApi DocumentsAPI() {
        return GroupedOpenApi.builder().group("文档管理").
                pathsToMatch("/documents/**").
                build();
    }
    @Bean
    public GroupedOpenApi RecommendationsAPI() {
        return GroupedOpenApi.builder().group("推荐管理").
                pathsToMatch("/recommendations/**").
                build();
    }


}